<template>
  <div>
    <Chead></Chead>
    <Cseach :citys='citys'></Cseach>
    <Clist :citys='citys' :hotcitys='hotcitys' :msg1='msg1'></Clist>
    <Fix :citys='citys' @change="getkey"></Fix>
  </div>
</template>

<script>
import Chead from './component/Chead'
import Cseach from './component/Cseach'
import Clist from './component/Clist'
import Fix from './component/Fix'
import axios from 'axios'
export default {
  name: 'city',
  components: {
    Chead,
    Cseach,
    Clist,
    Fix
  },
  data () {
    return {
      citys: {},
      hotcitys: [],
      msg1: ''
    }
  },
  methods: {
    getaxios () {
      axios.get('/api/city.json')
        .then(this.getsuccs)
    },
    getsuccs (ref) {
      const res = ref
      const res1 = res.data
      const data = res1.data
      this.hotcitys = data.hotCities
      this.citys = data.cities
    },
    getkey (msg) {
      this.msg1 = msg
    }
  },
  mounted () {
    this.getaxios()
  }
}
</script>

<style lang="stylus" scoped>

</style>
